<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<meta name="apple-touch-fullscreen" content="YES">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="/Public/projects/meeting/css/meetbase.css">
<title>会议签到</title>
</head>
<body>
<div id="mask"></div>
<div class="activityCard" style="z-index: 10006">
	 <div class="examineBanner"><img src="{$meet['bannerurl']}" alt="" style="height: 100px;"></div>
	<div class="activityindex">
    	<h1 class="h1activity">参与总人数<span class="spanAllNum colourway">{$count}</span>人</h1>
        <span class="spanSigned">已签到<span class="signedNum">{$used}</span>人，未签到<span class="signNum">{$unuse}</span>人</span>
    </div>
</div>
<div class="logintipsBox" id="logintipsBox">登录成功</div>
<div class="signPeploe">
	<ul class="ulSign">
    	<li><a class="<?php $get_unuse = I('get.unuse', 0, ''); if(empty($get_unuse)){ echo ' lisigned colourway colourwayBoder';} echo 'spancolor'?>" href="<?php echo '/Wap/Meeting/signin?meetId=' . I('get.meetId', '','');?>">已签到</a></li>
        <li><a class="<?php $get_unuse = I('get.unuse', 0, ''); if(!empty($get_unuse)){ echo ' lisigned colourway colourwayBoder';} echo 'spancolor';?>"  href="<?php echo '/Wap/Meeting/signin?meetId=' . I('get.meetId', '','') . '&unuse=1';?>">未签到</a></li>
    </ul>
    <div class="signBox">
        <?php
            $get_unuse = I("get.unuse", 0, '');
            echo '<div><ul class="';
            $spanSignNameClass = "signedName";
             $spanSignPhoneClass = "signedPhone";
            if(empty($get_unuse)){
                echo "ulsigned";
            }else{
                $spanSignNameClass = "nosignName";
                $spanSignPhoneClass = "signPhone";
                echo "noSign";
            }
            echo '">';
            foreach($users as $user){
                echo '<li><span class="' . $spanSignNameClass . '">' . $user['query_value1'] . '</span>';
                if(empty($get_unuse)){
                    echo '<span class="signedDate">' . $user['ticket_date'] . '</span>';
                }else{
                    echo '<span class="' . $spanSignPhoneClass . '">' . $user['query_value2'] . '</span>';
                }
                echo '</li>';
            }
            echo '</ul></div>';
        ?>
    </div>
</div>
<div class="scanbtn colourwaybg" id="scanbtn"></div>
<div class="registerbtn colourwaybg"></div>
<div class="finishBtn" onclick="end_sign();">结束签到</div>
<div class="cardTips">确定结束签到？<div class="cardFoot"><span onclick="cancel_confirm();">取消</span><span onclick="end_confirm();">确定</span></div></div>
<div class="divregister">
    <input type="text" id="ticket_signin" placeholder="请输入签到码" class="registerinput">
    <div class="registerSubmit"><input type="submit" class="inputregisterBtn" value="签到" onclick="hand_signin();"></div>
</div>
<script src="/Public/projects/meeting/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: '{$appid}', // 必填，公众号的唯一标识
        timestamp: "{$timestamp}", // 必填，生成签名的时间戳
        nonceStr: '{$nonceStr}', // 必填，生成签名的随机串
        signature: '{$wxSha1}',// 必填，签名，见附录1
        jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline', 'scanQRCode'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });
    wx.error(function(res){
        console.log(res);
    });
    var share_disable = "{$share_disable}";
    var meetId = "<?php echo I('get.meetId', '', '');?>";
    wx.ready( function( e ){
        if(share_disable == 1){
            wx.hideAllNonBaseMenuItem();
        }
        wx.onMenuShareAppMessage({
            title: "{$share_title}",
            desc: "{$share_desc}",
            link: "{$share_url}",
            imgUrl: "{$share_pic}",
            type: 'link',
            dataUrl: '',
            success: function () {
            }
        });
        wx.onMenuShareTimeline({
            title: "{$share_title}",
            link: "{$share_url}",
            imgUrl: "{$share_pic}",
            success: function () {
            }
        });
    });
    var color = "{$meet['theme_color']}";
    $("#scanbtn").click(function(){
        wx.scanQRCode({
            needResult: 1,
            scanType:["qrcode", "barCode"],
            success:function(res){
                var result = res.resultStr;
                $.ajax({
                    type:"post",
                    dataType:"json",
                    url:"/Wap/Meeting/scan",
                    data:{
                        ticket: result,
                        meetId: meetId
                    },
                    success:function(res1){
                        $("#logintipsBox").text(res1['msg']);
                        $("#logintipsBox").css("display","block");
                        setTimeout(function () {
                            location.reload();
                        }, 1000);
                    }
                });
            }
        });
    });
    function hand_signin(){
        var result = $("#ticket_signin").val();
        $.ajax({
            type:"post",
            dataType:"json",
            url:"/Wap/Meeting/scan",
            data:{
                ticket: result,
                meetId: meetId
            },
            success:function(res1){
                $("#logintipsBox").text(res1['msg']);
                $("#logintipsBox").css("display","block");
                setTimeout(function () {
                    location.reload();
                }, 1000);
            }
        });
    }
    function end_sign(){
        $("#mask").css("display", "block");
        $(".cardTips").css("display", "block");
    }
    function end_confirm(){
        $.ajax({
            url:"/Wap/Meeting/end_sign?meetId=" + meetId,
            type:"get",
            dataType:'json',
            success:function(res){

            }
        });
        $("#mask").css("display", "none");
        $(".cardTips").css("display", "none");
    }
    function cancel_confirm(){
        $("#mask").css("display", "none");
        $(".cardTips").css("display", "none");
    }
</script>
<script src="/Public/projects/meeting/js/common.js"></script>
</body>
</html>
